#include"Thread_pool.hpp"
#include"Task.hpp"
#include<unistd.h>

//懒汉模式
//在调用之前 先把这个使用对象的类构造起来，提供全局接口，供main函数调用

int main()
{
  ThreadPool<Task>*tp=new ThreadPool<Task>();
  tp->Thread_pool_init();

  srand((unsigned long)time(nullptr));
  const char*op="+-*/%";
  while(true)
  {
    int x=rand()%100+1;
    int y=rand()%100+1;
    Task t(x,y,op[x%5]);
    tp->push(t);
    sleep(1);
  }
  return 0;
}
